home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amoszine 9
/
Amoszine 9 (Disk 3 of 3).adf
/
Mikes_TMH_Source.lha
/
BlankerDemo.AMOS.Asc
< prev
next >
Wrap
Text File
|
1995-08-28
|
2KB
|
74 lines
'
' *********************************************************
' * Screen Saver Example *
' * by Mike Richmond *
' * *
' * Using AMON Extension's Rodent X, Rodent Y and Keycode *
' * so it works on ANY AMiga screen! (Not just Amos) *
' * *
' * Based on the skeleton code for TMH v1.0, but without *
' * Preferences file support, music, passwords etc. etc. *
' *********************************************************
'
'
WINDX=320 : WINDY=0 : Rem Window X and Y coordinates
TIMEOUT=1000
'
A$="CON:"-" "+Str$(WINDX)-" "+"/"-" "+Str$(WINDY)-" "+"/260/100/Screen Blanker Demo/NOSIZE"
Open Out 1,A$ : Rem Open a window on the Workench screen
Open Out 2,"CON:0/0/155/256/Dummy Window"
'
Screen Open 0,640,80,2,Hires : Flash Off : Curs Off : Cls 0
Screen Display 0,,120,,
Centre "** Screen Saver Demonstration **"
Cdown : Cdown : Centre "Opens a window on the Workench screen and counts down in jiffies"
Cdown : Centre "(50ths of a second) using the Timer variable. Move the mouse or press a key"
Cdown : Centre "to cancel the countdown or wait a bit to return to this screen!"
Cdown : Cdown : Centre "»» ANYKEY ««"
Wait Key
'
'
Timer=0 : Rem Reset the timer
Amos To Back : Rem send Amos to the back
X_BYTE=Rodent X
Y_BYTE=Rodent Y : Rem Store the mouse X/Y coordinates
'
Repeat
OX_BYTE=X_BYTE : OY_BYTE=Y_BYTE
X_BYTE=Rodent X : Rem <-- Rodent X = HARDWARE MOUSE X POSITION
Y_BYTE=Rodent Y : Rem <-- Rodent Y =HARDWARE MOUSE Y POSITION
'
Rem If mouse has moved...
If X_BYTE<>OX_BYTE
Timer=0
End If
'
If Y_BYTE<>OY_BYTE
Timer=0
End If
'
' Rem if any key has been pressed, keycode will have a value
If Keycode<>0 : Rem <-- Keycode holds the last key pressed
Timer=0
End If
'
' If Timer has passed the TIMEOUT limit
If Timer=>TIMEOUT
Amos To Front
End If
'
' Rem divide by 50 to convert to seconds
Print #1,"TIME ";Timer/50;" Secs","TIMEOUT ";TIMEOUT/50
'
Multi Wait : Rem Be friendly to the system!
'
Until Amos Here
'
Close 1 : Close 2 : Rem Close the 2 windows
'
Cdown : Cdown : Centre "** All Done! **"
Direct